package com.ulook.lookplanet.service;

import com.ulook.lookplanet.bean.VArticlePreInfo;
import com.ulook.lookplanet.mapper.TopicMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 描述：
 *
 * @author L1998
 * @date 2021/4/21
 */
@Service
public class TopicService {

    @Autowired
    private TopicMapper mapper;

    /**
     * 根据小组id获取帖子
     */
    public List<VArticlePreInfo> getArticleForComuId(String comuid, int userid, int itemNum){
        return mapper.getArticleForComuId(comuid, userid, itemNum);
    }

    /**
     * 根据话题id获取帖子
     */
    public List<VArticlePreInfo> getArticleForTopicId(String topicid, int userid, int itemNum){
        return mapper.getArticleForTopicId(topicid, userid, itemNum);
    }

    /**
     * 根据用户id搜索帖子
     */
    public List<VArticlePreInfo> getArticleByUserId(int userid, int itemNum){
        return mapper.getArticleByUserId(userid, itemNum);
    }

    /**
     * 删除
     */
    public void deleteArticleByUid(String uid){
        mapper.deleteArticleByUid(uid);
    }
}
